Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.

[#55] 푸시 서비스 적용 #57

Merged
merged 36 commits into from
Jan 16, 2020

Conversation

yyy9942
Copy link
Collaborator

@yyy9942 yyy9942 commented Dec 31, 2019

푸시 적용할 곳이 아직 없네요.

yyy9942 and others added 12 commits November 27, 2019 15:25
- import * 제거
- 비슷한 테스트 통합

나머지 내용은 본 로직이 수정되어야 해서  코드 수정해달라고 요청하였습니다.
- ShopServiceTest addShop() 테스트 코드 추가
- 쿠폰발급, 발급쿠폰 사용기능 추가
- 주석 빠진 부분 추가
- 로직만 작성했던 부분을 postman 테스트하면서 잘못 설정된 부분을 고쳤습니다.
푸시 적용할 곳이 아직 없네요.
@yyy9942 yyy9942 self-assigned this Dec 31, 2019
@f-lab-dev
Copy link
Member

브랜치명은 왠만하면 한글을 넣지않고 이슈번호로 관리하시는게 좋습니다~ 뭔가 쓰더라도 영어로 쓰는게 좋고요

request.getItems(), request.getShopId());

// 사장님에게 푸시 메세지 전송
PushMessage pushMsg = new PushMessage("DelFood 주문", "새로운 주문이 들어왔습니다.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

객체 생성보다는 팩토리 메소드를 활용하면 더 깔끔해보일 것 같습니다~ 혹은 빌더를 사용하면 더 깔끔해보일 것 같네요.
그리고 이 경우는 객체의 값이 고정되어있으므로 상수로 선언하는게 좋을 것 같네요

// 사장님에게 푸시 메세지 전송
PushMessage pushMsg = new PushMessage("DelFood 주문", "새로운 주문이 들어왔습니다.");
String ownerId = shopService.getShop(request.getShopId()).getOwnerId();
pushService.sendMessageToOwner(pushMsg, ownerId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

푸시메세지 전송은 비즈니스로직에 속합니다. Controller가 아닌 Service에 들어가야할 것 같습니다~

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그리고 Service에 들어가게되면 @Transactional을 타게 될텐데 푸시 전송에 실패해서 예외가 발생하면 주문을 롤백해야할까요? 이 점에 대해서도 고민해보시면 좋을 것 같습니다~

yyy9942 and others added 11 commits January 3, 2020 12:48
- 푸시 메세지 전송시 에러가 발생하면 예외를 발생시키지 않음. 대신 로그에 해당 정보를 기록하고 redis에 해당 오류가 난
정보를 기록하여 추후 다시 푸시메세지 전송을 시도할 수 있도록 함
- 주문 INSERT시 배달료가 DB에 입력되지 않던 버그 수정
- 푸시 토큰이 0개이면 예외 발생하던 것을 로그만 찍어주도록 변경
[#59] 장바구니 서비스 대상 테스트코드 작성
Conflicts:
	pom.xml
	src/main/java/com/delfood/dto/ShopDTO.java
	src/main/java/com/delfood/error/ErrorController.java
yyy9942 and others added 8 commits January 10, 2020 12:58
- 발행 쿠폰 조회시 NULL 체크
- 로그 하나로 통합
- coupon이 'cooupon'으로 오타가 났던 것을 수정

주문성공시 상태 변경
- 결제 완료시 order_status가 'BEFOR_PAYMENT'에서 'ORDER_REQUEST'로 변경되도록 설정함

주문이 중간에 실패하더라도 기록이 남도록 변경
- 트랜잭션 경계 설정을 통해 실패시 기록을 남기도록 설정
- 주문 승인 시 도착예정시간 설정 가능
- 주문 승인 시 고객에게 알림 메세지 전송
- 메서드 이름 변경
- 회원 가입
- 로그인
- 로그아웃
- 아이디와 비밀번호로 유효성 검사
- 비밀번호 변경
- 메일 변경
Coupon에 대한 테스트코드 작성
- 어노테이션 개선
- 리플랙션을 활용하여 어노테이션 내부 로직 변경

@AllArgsConstructor
public static enum Type {
addOrderRequest(new PushMessage("DelFood 주문", "새로운 주문이 들어왔습니다")),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이곳은 enum보다는 PushMessage 안에 상수로 정의하는게 사용성면에서 더 좋을 것 같네요~

@yyy9942 yyy9942 merged commit 9520e3c into 푸시_서비스_구현 Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants